#pragma once
#ifndef OBR_LIGHT_H
#define OBR_LIGHT_H

#include "Configurable.h"
#include "Mesh.h"
#include "SharedDS/LightData.h"
#include "VirtualProgramEntry.h"
#include "common.h"
#include "helpers/Helpers.h"

namespace OBR
{

class Light : public VirtualProgramEntry
{
private:
    // methods
public:
    LightType type;
    Light(std::string _cuda_source_path, LightType _type);
    ~Light();

    /**
     * @brief Get light info description object
     *
     * @return LightInfo
     */
    LightInfo getInfo();
};

class DeltaLight : public Light
{
public:
    DeltaLight(std::string _cuda_source_path);
    ~DeltaLight();
};

class AreaLight : public Light
{
public:
    // this is set when Instance::updateLocalToWorld is called
    Matrix4x4f local2world = Matrix4x4f(1.0f);
    std::shared_ptr<Mesh> mesh;

public:
    AreaLight(std::string _cuda_source_path);
    virtual ~AreaLight();

    /**
     * @brief link and check given mesh when Instance::linkChild is called
     *
     * @param mesh
     */
    virtual void linkMesh(std::shared_ptr<Mesh> _mesh) = 0;
};

} // namespace OBR

#endif